export const useUserStore = defineStore('userStore',()=>{
  const token = ref('')
  const userInfo = ref({})
  const isAuthenticated = computed(() => !!token.value)
  function setToken(val:string) {
    token.value = val
  }
  function setUserInfo(val:Object) {
    userInfo.value = val
  }
  return {
    token,
    userInfo,
    isAuthenticated,
    setToken,
    setUserInfo
  }
},
{
  persist: true
}
)
